/*
 * snmp_asn_type.cpp
 *
 *  Created on: 2017-1-20
 *      Author: root
 */
#include"snmp_asn.h"
#include"PublicLog.h"
#include<sys/types.h>
#include<string.h>
typedef struct _ASNTYPEDESCR{
u_char type;
const char*descr;
}ASNTYPEDESCR;
static ASNTYPEDESCR asntypedefsr[]={
{ASN_BOOLEAN,"Bool"},
{ASN_INTEGER,"INT"},
{ASN_BIT_STR,"Bit"},
{ASN_OCTET_STR,"String"},
{ASN_NULL,"Null"},
{ASN_OBJECT_ID,"ObjectID"},
{ASN_IPADDRESS,"IPAddress"},
{ASN_COUNTER,"Counter"},
{ASN_GAUGE,"Gauge"},
{ASN_TIMETICKS,"Timeticks"},
{ASN_COUNTER64,"Counter64"},
{0,"未知"}
};
const char*GetAsnTypeName(u_char type){
    int i=0;
    while(asntypedefsr[i].type!=0){
      if(asntypedefsr[i].type==type)
         return asntypedefsr[i].descr;
      i++;
    }
   return "未知";
}
